﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cheetah_Fast_Banking_App
{
    public class BillPay
    {
        //public Account Account { get; set; }

        public Guid ID { get; set; }
        public string Description { get; set; }
        public DateTime FirstDate { get; set; }
        public DateTime? LastDate { get; set; }
        public bool Active { get; set; }
        public Interval Interval { get; set; }
        public string IntervalString
        {
            get { return Interval.ToString(); }
            set
            {
                Interval i;
                if (!Enum.TryParse<Interval>(value, out i))
                    return;
                this.Interval = i;
            }
        }
        public decimal Amount { get; set; }

        public BillPay(string description,
            DateTime firstDate,
            DateTime? lastDate,
            bool active,
            Interval interval,
            decimal amount)
            : this (description, firstDate, lastDate, active, interval, amount, Guid.NewGuid())
        { }

        public BillPay(string description,
            DateTime firstDate,
            DateTime? lastDate,
            bool active,
            Interval interval,
            decimal amount,
            Guid id)
        {
            this.ID = id;
            this.Description = description;
            this.FirstDate = firstDate;
            this.LastDate = lastDate;
            this.Active = active;
            this.Interval = interval;
            this.Amount = amount;
        }
    }
}
